Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add discount icon with discount package in contracts table #3392

Open
wants to merge 16 commits into
base: development
Choose a base branch
from

Conversation

amiraabouhadid
Copy link
Contributor

@amiraabouhadid amiraabouhadid commented Sep 9, 2024

Description

  • added a discount icon tooltip in the billing rate column of the contracts table that displays discount package type when user hovers over icon.

Changes

  • UI changes for the icon in contracts table
  • Graphql fetch discount package function in contracts module in grid_client

Related Issues

#2477

Tested Scenarios

  • account with over 1M TFTs balance and multiple deployed node & name contracts
  • account with only 2 TFTs balance and 3 deployed node contracts
  • account with over 1K TFTs and multiple deployed node and name contracts
  • started out with an account with below 1K TFT, funded account to over 1M TFT , observe package change from default to gold

Documentation PR

For UI changes, Please provide the Documetation PR on info_grid
image

Checklist

  • Tests included
  • Build pass
  • Documentation
  • Code format and docstrings
  • Screenshots/Video attached (needed for UI changes)

@0oM4R
Copy link
Contributor

0oM4R commented Sep 17, 2024

can we add some spaces between the icon and the text ? as Ehab did here #2477 (comment)

Copy link
Contributor

@zaelgohary zaelgohary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Icon styling looks a bit weird. I think it should be next to the price.

image

@zaelgohary
Copy link
Contributor

Also, I have a gold discount while my current balance is zero and the contract is in grace period. Is this right? I've waited till a new billing cycle is entered.

image

@0oM4R
Copy link
Contributor

0oM4R commented Sep 18, 2024

I founded my account yesterday with 10K TFT, but the package doesn't changed

@0oM4R
Copy link
Contributor

0oM4R commented Sep 19, 2024

I founded my account yesterday with 10K TFT, but the package doesn't changed

funded my account with more than 1 million tft and still have the same discount levels after more than 12h
image

async getDiscountPackage(options: GetDiscountPackageOptions): Promise<DiscountLevel> {
const gqlClient = new Graphql(options.graphqlURL);
const body = `query getConsumption($contractId: BigInt!){
contractBillReports(where: {contractID_eq: $contractId}, limit: 1 ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this will make the first discount package will always displayed, i suggest to remove limit and get the last element in the list this may fix the issue

@amiraabouhadid amiraabouhadid marked this pull request as draft September 19, 2024 10:33
@amiraabouhadid
Copy link
Contributor Author

Icon styling looks a bit weird. I think it should be next to the price.

image

this happens in smaller screen sizes, yes.

@amiraabouhadid
Copy link
Contributor Author

@0oM4R started out with a default package
Screenshot from 2024-12-29 14-44-34

after funding account with 1M TFT, package changed to gold in less than 3hrs
image

@amiraabouhadid amiraabouhadid marked this pull request as ready for review December 29, 2024 14:18
Copy link
Contributor

@0oM4R 0oM4R left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image i can't list the contracts, I can list them on development, maybe it is related to the gridproxy issue so i can't verify now

@amiraabouhadid
Copy link
Contributor Author

image i can't list the contracts, I can list them on development, maybe it is related to the gridproxy issue so i can't verify now

i had no problem listing them before today so definitely gridproxy issue

@maayarosama
Copy link
Contributor

Text overlap on smaller screens
Screenshot from 2025-01-12 11-49-57

@amiraabouhadid
Copy link
Contributor Author

UI changed to
image
image

@ehab-hassan
Copy link
Contributor

ehab-hassan commented Jan 13, 2025

e8a4971d-138f-49d2-9b03-30b940e00d9b
@amiraabouhadid I believe placing the discount icon on the right at all sizes would look better, even if it doesn't align perfectly with the other vertical rows.

@amiraabouhadid
Copy link
Contributor Author

updated
image

@0oM4R
Copy link
Contributor

0oM4R commented Jan 15, 2025

created a vm with a wallet that has 10M TFT, will update the comment later with the results
contract ID : 185205

@0oM4R
Copy link
Contributor

0oM4R commented Jan 15, 2025

image
works as expected will keep only less than 200 TFT to check the discount change

@0oM4R
Copy link
Contributor

0oM4R commented Jan 16, 2025

now discount shows none
image

transfared 4000TFT and after refresh got silver
image

async getDiscountPackage(options: GetDiscountPackageOptions): Promise<DiscountLevel> {
const gqlClient = new Graphql(options.graphqlURL);

const body = `query getConsumption($contractId: BigInt!){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice that we can add order to the request body; i think this will be better
image


<v-tooltip bottom color="primary" close-delay="100" v-if="item.discountPackage" cols="2">
<template v-slot:activator="{ props }">
<v-icon class="scale_beat mr-2" color="warning" v-bind="props">mdi-brightness-percent</v-icon>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we should remove the mr-2 no need for it

v-if="item?.consumption !== 0 && item?.consumption !== undefined"
class="d-flex justify-center align-center"
>
<p class="mr-2" cols="8">{{ item.consumption.toFixed(3) }} TFT/hour</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
using text-no-wrap may fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants